#include<iostream>
#include<conio.h>
#include<stdio.h>

using namespace std;

class CPolygon
{
protected:
	int width;
	int height;
public:
	void setValues(int a,int b);
};
void CPolygon::setValues(int a,int b)
{
	width = a;
	height = b;
}

class CRectangle:public CPolygon
{
public:
	int area();
};
int CRectangle::area()
{
	return( width * height );
}
class CTriangle:public CPolygon
{
public:
	int area();
};
int CTriangle::area()
{
	return( width * height /2);
}
int main()
{
	CRectangle rect;
	CTriangle trgl;
	rect.setValues(4,5);
	trgl.setValues(4,5);
	cout<<"rect: "<<rect.area()<<endl;
	cout<<"\n";
	cout<<"trgl: "<<trgl.area()<<endl;
	getch();
	return 0;
}
